package ua.com.abakumov.android.prostopleer.engines.u

import java.net.{URLEncoder, URI}
import java.nio.charset.Charset
import org.apache.http.client.utils.URIUtils

/**
 *
 * User: aabakumov, Date: 28.12.12, Time: 16:39 
 */
class UriHelper {

  def createUri(protocol: String, host: String, path: String,
                query: String, request: String): URI = {

    val encodedString = URLEncoder.encode(request, Charset.defaultCharset().name())
    URIUtils.createURI(protocol, host, -1, path, query + encodedString, null)
  }

}
